package net.crazyadam

import math._

/**
 *
 * @author joseph
 * @since 6/17/12 1:42 PM
 */

class Point(longi: Double, lati: Double, alti: Double) {
  /**
   * radians
   */
  private var thet = 0.0
  //相鄰兩點偏角
  private var preThet = 0.0 //中間相隔一點的，兩個點的偏角
  var vali=true
  var n=""
  /**
   * 小於Pi/2的數據將+2*Pi轉化爲正值
   * @param t theta
   */
  def theta_=(t: Double) {
    thet = t
  }

  def theta = thet

  def preTheta = preThet

  def preTheta_=(t: Double) {
    preThet = t
  }

  override def toString = {
    //longitude + "," + latitude + "," + altitude + "," +
    "("+n+","+vali+"," +  toDegrees(thet) + "," + toDegrees(preThet) + ")"
  }

  def latitude = lati

  def longitude = longi

  def altitude = alti
  def valid=vali
  def valid_=(v:Boolean) {vali=v}
  def name=n
  def name_=(n:String){this.n=n}
}
